package com.zero.youxiao.dao;


import javax.inject.Inject;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.zero.basic.dao.DefaultBaseDao;
import com.zero.basic.dao.HqlQueryBaseDao;
import com.zero.basic.dao.SqlUpdateBaseDao;
import com.zero.mms.model.UserAccount;

@Repository("userAccountDao")
@Transactional(rollbackFor = Exception.class)
public class UserAccountDaoImpl extends DefaultBaseDao<UserAccount> implements
		UserAccountDao {

	@Inject
	private HqlQueryBaseDao<?> hqlQueryBaseDao;

	public UserAccount findByName(String phoneNum) {
		String hql = "from UserAccount u where u.userName = ?";
		UserAccount user = (UserAccount) hqlQueryBaseDao.queryObject(hql,
				phoneNum);
		return user;
	}
}
